# Maintainer: Renato Silva <br.renatosilva@gmail.com>

pkgname='vimpager'
pkgdesc='Use ViM as PAGER'
url='http://www.vim.org/scripts/script.php?script_id=1723'
license=(BSD)
arch=(any)
pkgver=2.06
pkgrel=1
depends=(vim sharutils)
source=(${pkgname}-${pkgver}.tar.gz::"https://github.com/rkitover/${pkgname}/archive/${pkgver}.tar.gz")
sha256sums=('cc616d0840a6f2501704eea70de222ab662421f34b2da307e11fb62aa70bda5d')
noextract=(${pkgname}-${pkgver}.tar.gz)

prepare() {
  [[ -d ${srcdir}/${pkgname}-${pkgver} ]] && rm -rf ${srcdir}/${pkgname}-${pkgver}
  tar -xzf ${srcdir}/${pkgname}-${pkgver}.tar.gz -C ${srcdir} || true
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make vimpager
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" SYSCONFDIR='/etc' PREFIX='/usr' install
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
